//
//  UIImage+AMKLaunchTimeProfiler.m
//  AMKLaunchTimeProfiler
//
//  Created by mengxinxin on 2022/3/24.
//

#import "UIImage+AMKLaunchTimeProfiler.h"

@implementation UIImage (AMKLaunchTimeProfiler)

#pragma mark - Init Methods

// 转换工具：https://c.runoob.com/front-end/59/
+ (UIImage *)amkltp_imageWithType:(AMKLaunchTimeProfilerImageType)type {
    NSString *encodedImageString = nil;
    switch (type) {
        case AMKLaunchTimeProfilerImageTypeNaviBarClose: encodedImageString = @""; break;
        case AMKLaunchTimeProfilerImageTypeNaviBarMore: encodedImageString = @""; break;
        case AMKLaunchTimeProfilerImageTypeNaviBarFilter: encodedImageString = @""; break;
        case AMKLaunchTimeProfilerImageTypeNaviBarFilterSelected: encodedImageString = @""; break;
        default: break;
    }
    
    if (!encodedImageString.length) return nil;
    
    NSRange range = [encodedImageString rangeOfString:@";base64,"];
    if (range.location != NSNotFound) encodedImageString = [encodedImageString substringFromIndex:range.location+range.length];
    
    NSData *decodedImageData = [NSData.alloc initWithBase64EncodedString:encodedImageString options:0];
    UIImage *decodedImage = [UIImage imageWithData:decodedImageData scale:2];
    return decodedImage;
}

#pragma mark - Getters & Setters

#pragma mark - Data & Networking

#pragma mark - Public Methods

#pragma mark - Private Methods

#pragma mark - Notifications

#pragma mark - KVO

#pragma mark - Protocol

#pragma mark - Overrides

#pragma mark - Helper Methods

@end
